package com.example.hospitalsystem.mapper;

import com.example.hospitalsystem.pojo.entity.Consultation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 门诊医生接诊表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-04-15
 */
@Mapper
public interface ConsultationMapper extends BaseMapper<Consultation> {
    /**
     * 根据患者名删除对应医生接诊表数据
     * @param patientName
     */
    @Delete("delete from consultation where patient_name = #{patientName}")
    void deleteConsultationByPatientName(String patientName);

    /**
     * /更新该患者的缴费状态
     * @param patientName
     */
    @Update("update consultation set pay_status = 1 where patient_name = #{patientName}")
    void updatePayStatus(String patientName);

//    @Update("update consultation set pay_status = #{payStatus} where ")
//    void updatePayStatusForPatient(Integer payStatus);
}
